package com.evildog.workspace.common.enums;

import com.evildog.workspace.common.intefaces.ICustomExceptionDesc;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 返回前端状态码 demo
 *
 * 各个模块以约定的code格式，实现自己的 CustomExceptionDesc
 */
@AllArgsConstructor
@Getter
public enum CommonCustomExceptionDesc implements ICustomExceptionDesc {

    BAD_REQUEST("A100001", "bad request",""),
    NOT_FOUND("A100002", "not found",""),
    CONFLICT("A100003", "conflict",""),
    PRECONDITION_FAILED("A100004", "Precondition Failed",""),
    UNAUTHORIZED("A100005", "unauthorized","没有登录/或者登录已过期"),
    FORBIDDEN("A100006", "forbidden！","请求不被允许"),

    SERVER_ERROR("B100001", "internal server error",""),

    /**
     * 设置001占位
     * @see com.evildog.workspace.dependencies.web.advice.ExceptionHandleAdvice#handleFeignException
     */
    FEIGN_EXCEPTION("C100001", "feign_exception！","feign_exception"),

    LUNAR_CALENDAR_LUNAR_ERROR("C100002", "LunarCalendar parse lunar properties error！","LunarCalendar parse lunar properties error！"),
    LUNAR_CALENDAR_FESTIVAL_ERROR("C100003", "LunarCalendar parse festival properties error！","LunarCalendar parse festival properties error！"),
    LUNAR_CALENDAR_NOT_INIT("C100004", "LunarCalendar is not init！","LunarCalendar is not init"),

    ;

    /**
     * 状态码
     */
    private String code;
    /**
     * 信息，前端展示信息
     */
    private String message;

    /**
     * 描述
     */
    private String description;


}
